package com.lagou.sqlSession;

import com.lagou.pojo.Configuration;
import com.lagou.pojo.MappedStatement;

import java.sql.SQLException;
import java.util.List;

public interface Executor {
    /**
     * 查询用户信息
     * @param configuration
     * @param mappedStatement
     * @param params
     * @param <E>
     * @return
     * @throws SQLException
     * @throws Exception
     */
    public <E> List<E> query(Configuration configuration, MappedStatement mappedStatement, Object... params) throws SQLException, Exception;

    /**
     * 根据条件更新用户信息
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     */
    public boolean update(Configuration configuration, MappedStatement mappedStatement, Object... params) throws Exception;

    /**
     * 新增用户
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     */
    public boolean insert(Configuration configuration, MappedStatement mappedStatement, Object... params) throws Exception;

    /**
     * 通过用户ID删除用户
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     * @throws Exception
     */
    public boolean delete(Configuration configuration, MappedStatement mappedStatement, Object... params) throws Exception;

}
